//
// Created by 11510 on 2024/6/9.
//

#ifndef STACK_STACK_H
#define STACK_STACK_H


class Stack {
private:
    int *_elements;
    int _size;
    int _capacity;
    int _top;


public:
    Stack();
    Stack(int capacity);
    ~Stack();
    Stack(const Stack& rhs);
    Stack& operator=(const Stack &rhs);

    bool empty();	//判断栈是否为空
    bool full();	//判断栈是否已满
    void push(int elem); //元素入栈
    void pop();     //元素出栈
    int  top();		//获取栈顶元素
};


#endif //STACK_STACK_H
